
import request from '@/utils/request'

// 生成视频
export function generateVideo(data) {
  return request({
    url: '/video/generate',
    method: 'post',
    data
  })
}

// 获取用户视频列表
export function getVideoList(params) {
  return request({
    url: '/video/list',
    method: 'get',
    params
  })
}

// 根据ID查询视频
export function getVideoById(id) {
  return request({
    url: `/video/${id}`,
    method: 'get'
  })
}

// 下载视频
export function downloadVideo(id) {
  return request({
    url: `/video/${id}/download`,
    method: 'get',
    responseType: 'blob'
  })
}

// 删除视频
export function deleteVideo(id) {
  return request({
    url: `/video/${id}`,
    method: 'delete'
  })
}

// 获取视频生成进度
export function getVideoProgress(id) {
  return request({
    url: `/video/${id}/progress`,
    method: 'get'
  })
}

// 重新生成视频
export function regenerateVideo(id) {
  return request({
    url: `/video/${id}/regenerate`,
    method: 'post'
  })
}
